fix(SystemBars): make safe-area-inset-x available on API <= 34 - #8424
Conversation
|
Hi, thanks for this PR. |
|
@luisbytes Do you have a test app that I can play around with and test some changes against? |
|
@theproducer |
|
@theproducer Upon reviewing, I noticed that the AdMob plugin adds padding based on the safe area, but only for Android 15+. This leaves me wondering how plugins that need to display something natively on screen should handle the safe area: based on the WebView version or the Android version? I'll also leave a Playground repository. I encountered more problems with the AdMob plugin on Android 15 and 16 with WebViews lower than 140 (it works fine in the latest WebView versions). The cause is this pull request: #8384. Downgrading to 8.2.0 fixes it. In conclusion, I believe this pull request can be merged, but guidelines or suggestions should be established for plugins that want to display native objects on WebViews. For now, I applied this patch to the patch/admob branch of the admob plugin, adding native padding based on the webview version, just like the systembars plugin currently does. I tested it on Android 11, 14, 15, and 16 with Webview <140 and >140, and it works fine. I'm considering whether to submit a PR to the AdMob plugin if these changes are mixed, applying padding based on the webview version. |
|
@luisbytes I removed That should fix the immediate issue with AdMob. |
|
@theproducer Thank you very much, I will try it. One question: will |
|
@theproducer I ran a test, but nothing changed; the banner is broken. It's having double padding added to the bottom on Android 15+ with a Webview below 140. I updated the test repository.
After downgrading to @capacitor/android@8.2.0, everything works as it should. |
|
@luisbytes Can you pull the latest from this branch and see if that fixes your double padding issue? |
@theproducer I ran the test, and this last error is still occurring. It should be noted that this only happens on Android 15+ and on Webview versions lower than 140. I also updated the test repository. Applying the patch with the changes from this PR in the README contains instructions on how to run the app. |
|
@luisbytes Hmm, I was able to reproduce your issue. However, for Android 15+ in the AdMob
I obviously didn't do a full run of tests, but that might be all there is to it. |
|
Thanks, @theproducer. Maybe we should merge this and deal with the AdMob plugin later. Should |
Yes, it should, and I'll be dealing with that in the next PR. |
…-area-inset-x` available on API <= 34 (#70) * fix: injecting custom safe area insets for all Android versions * fmt * calling `WindowCompat.setDecorFitsSystemWindows` * Setting safe area insets to zero --------- Co-authored-by: Joseph Pender <joey.pender@outsystems.com> Co-authored-by: Capacitor+ Bot <bot@capgo.app>
…equest bodies (#87) * Release 8.3.2 * fix(cli): copy plugin files in CocoaPods projects (ionic-team#8467) * Release 8.3.3 * chore(cli): update telemetry endpoint (ionic-team#8464) * Release 8.3.4 * chore: format java code (ionic-team#8475) * chore: format java code (ionic-team#8477) * feat: add method getDouble to plugin config (ionic-team#7638) Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> * fix(SystemBars): make `safe-area-inset-x` available on API <= 34 (ionic-team#8424) * fix(http): support binary request bodies * fix(http): support binary request bodies (cherry picked from commit 5bfdb1d) Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com> --------- Co-authored-by: Github Workflow (on behalf of markemer) <users.noreply.github.com> Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> Co-authored-by: Alex J. <alexandre.jacinto@outsystems.com> Co-authored-by: Robin Genz <mail@robingenz.dev> Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: Angel J <78835633+iamanaws@users.noreply.github.com> Co-authored-by: Capacitor+ Bot <bot@capgo.app> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
…e data type generic (#85) * Release 8.3.2 * fix(cli): copy plugin files in CocoaPods projects (ionic-team#8467) * Release 8.3.3 * chore(cli): update telemetry endpoint (ionic-team#8464) * Release 8.3.4 * chore: format java code (ionic-team#8475) * chore: format java code (ionic-team#8477) * feat: add method getDouble to plugin config (ionic-team#7638) Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> * fix(SystemBars): make `safe-area-inset-x` available on API <= 34 (ionic-team#8424) * feat(cli): add experimental packageOptions (ionic-team#8471) * feat(cli): capture ios_package_manager in telemetry (ionic-team#8482) * fix(cli): revert live reload config on failure (ionic-team#8485) * chore: fix typo in declarations.ts (ionic-team#8488) * fix(SystemBars): respect `insetsHandling` disable (ionic-team#8481) * fix(android): show only the requested system bar (ionic-team#8480) Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: Pedro Bilro <pedro.gustavo.bilro@outsystems.com> Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> * chore: Decrease timeout for CI jobs from 60 to 30 minutes (ionic-team#8476) Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> * Release 8.4.0 * fix(cli): patch Capacitor SPM dependency version in plugins (ionic-team#8492) Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> * fix(cli): make SPM dependency patch work on prereleases (ionic-team#8508) * Release 8.4.1 * fix(core): make HttpResponse data type generic * fix(docs): update HttpResponse examples to use generic type * fix(core): make HttpResponse data type generic (cherry picked from commit 525c6f7) * fix(docs): update HttpResponse examples to use generic type (cherry picked from commit 462a05a) --------- Co-authored-by: Github Workflow (on behalf of markemer) <users.noreply.github.com> Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> Co-authored-by: Alex J. <alexandre.jacinto@outsystems.com> Co-authored-by: Robin Genz <mail@robingenz.dev> Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: Minh Vu <vuhoangminh97@gmail.com> Co-authored-by: Pedro Bilro <pedro.gustavo.bilro@outsystems.com> Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> Co-authored-by: Mohamed Ben Makhlouf <med.b.makhlouf@gmail.com> Co-authored-by: Capacitor+ Bot <bot@capgo.app> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
…ieStore observer so cookie sync works (#83) * Release 8.3.2 * fix(cli): copy plugin files in CocoaPods projects (ionic-team#8467) * Release 8.3.3 * chore(cli): update telemetry endpoint (ionic-team#8464) * Release 8.3.4 * chore: format java code (ionic-team#8475) * chore: format java code (ionic-team#8477) * feat: add method getDouble to plugin config (ionic-team#7638) Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> * fix(SystemBars): make `safe-area-inset-x` available on API <= 34 (ionic-team#8424) * feat(cli): add experimental packageOptions (ionic-team#8471) * feat(cli): capture ios_package_manager in telemetry (ionic-team#8482) * fix(cli): revert live reload config on failure (ionic-team#8485) * chore: fix typo in declarations.ts (ionic-team#8488) * fix(SystemBars): respect `insetsHandling` disable (ionic-team#8481) * fix(android): show only the requested system bar (ionic-team#8480) Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: Pedro Bilro <pedro.gustavo.bilro@outsystems.com> Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> * chore: Decrease timeout for CI jobs from 60 to 30 minutes (ionic-team#8476) Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> * Release 8.4.0 * fix(cli): patch Capacitor SPM dependency version in plugins (ionic-team#8492) Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> * fix(cli): make SPM dependency patch work on prereleases (ionic-team#8508) * Release 8.4.1 * chore: run `npm run fmt` to fix lint errors (ionic-team#8516) * fix(ios): retain WKHTTPCookieStore observer so cookie sync works * fix(ios): retain WKHTTPCookieStore observer so cookie sync works (cherry picked from commit 3fc41b8) --------- Co-authored-by: Github Workflow (on behalf of markemer) <users.noreply.github.com> Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> Co-authored-by: Alex J. <alexandre.jacinto@outsystems.com> Co-authored-by: Robin Genz <mail@robingenz.dev> Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: Minh Vu <vuhoangminh97@gmail.com> Co-authored-by: Pedro Bilro <pedro.gustavo.bilro@outsystems.com> Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> Co-authored-by: Mika Ruch <mika.ruch@zuehlke.com> Co-authored-by: Capacitor+ Bot <bot@capgo.app> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
… truncation (#71) * Release 8.3.2 * fix(cli): copy plugin files in CocoaPods projects (ionic-team#8467) * Release 8.3.3 * chore(cli): update telemetry endpoint (ionic-team#8464) * Release 8.3.4 * chore: format java code (ionic-team#8475) * chore: format java code (ionic-team#8477) * feat: add method getDouble to plugin config (ionic-team#7638) Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> * fix(SystemBars): make `safe-area-inset-x` available on API <= 34 (ionic-team#8424) * feat(cli): add experimental packageOptions (ionic-team#8471) * feat(cli): capture ios_package_manager in telemetry (ionic-team#8482) * fix(cli): revert live reload config on failure (ionic-team#8485) * chore: fix typo in declarations.ts (ionic-team#8488) * fix(android): range request truncation * fix(android): range request truncation (cherry picked from commit 6a9f325) --------- Co-authored-by: Github Workflow (on behalf of markemer) <users.noreply.github.com> Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> Co-authored-by: Alex J. <alexandre.jacinto@outsystems.com> Co-authored-by: Robin Genz <mail@robingenz.dev> Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: bwees <brandonwees@gmail.com> Co-authored-by: Capacitor+ Bot <bot@capgo.app> Co-authored-by: Cursor Agent <cursoragent@cursor.com>
) * Release 8.3.2 * fix(cli): copy plugin files in CocoaPods projects (ionic-team#8467) * Release 8.3.3 * chore(cli): update telemetry endpoint (ionic-team#8464) * Release 8.3.4 * chore: format java code (ionic-team#8475) * chore: format java code (ionic-team#8477) * feat: add method getDouble to plugin config (ionic-team#7638) Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> * fix(SystemBars): make `safe-area-inset-x` available on API <= 34 (ionic-team#8424) * feat(cli): add experimental packageOptions (ionic-team#8471) * feat(cli): capture ios_package_manager in telemetry (ionic-team#8482) * fix(cli): revert live reload config on failure (ionic-team#8485) * chore: fix typo in declarations.ts (ionic-team#8488) * fix(SystemBars): respect `insetsHandling` disable (ionic-team#8481) * fix(android): show only the requested system bar (ionic-team#8480) Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: Pedro Bilro <pedro.gustavo.bilro@outsystems.com> Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> * chore: Decrease timeout for CI jobs from 60 to 30 minutes (ionic-team#8476) Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> * Release 8.4.0 * fix(cli): patch Capacitor SPM dependency version in plugins (ionic-team#8492) Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> * fix(cli): make SPM dependency patch work on prereleases (ionic-team#8508) * Release 8.4.1 * chore: run `npm run fmt` to fix lint errors (ionic-team#8516) * fix(android): explicitly grant URI permissions for image capture intent (ionic-team#8526) * Release 8.4.2 * chore(android): fix lint issues (ionic-team#8542) * fix(cli): support TypeScript 7 when loading capacitor.config.ts (ionic-team#8534) * feat(ios): UIScene Support (ionic-team#8536) * feat(cli): add migrator functionality for adopting UIScene (ionic-team#8544) * Release 8.5.0 * fix(cli): use POSIX paths in CapApp-SPM Package.swift (ionic-team#8549) Co-authored-by: Cursor <cursoragent@cursor.com> * fix(core): prevent removeListener from removing wrong listener (ionic-team#8271) Co-authored-by: Eric Horodyski <horodyski@ionic.io> * fix: address PR #115 review findings and lint failures Restore @capacitor-plus package identity after upstream sync, fix SystemBars safe-area and navBarVisible handling, harden UIScene migration and CLI telemetry paths, align ci.yml with repo Bun policy, and restore plus-specific test coverage. Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com> * fix(ios): unwrap weak self in CAPSceneDelegateProxy observer Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com> * fix(cli): set fileRef when adding existing PBXFileReference to target Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com> * fix(ci): pin workflow actions to immutable commit SHAs Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com> * fix: resolve 18 Minor/Trivial PR review threads - Changelog: restore plus release history, fix MD001 headings, add 8.3.12 section - CLI: TS7 strip-only fallback via bundled compiler, run.ts error handling, migrate-uiscene brace scanner, SPM version lookup guard, xcode.spec guard order - iOS: per-scene bridge readiness in CAPSceneDelegateProxy, drop redundant delegateClass in TestsHostApp, remove UISceneStoryboardFile from templates Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com> * test(cli): expect no UISceneStoryboardFile in scene manifest Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com> * fix(cli): correct Swift string parsing and xcode build comments - findMatchingBrace: proper # raw string open/close and stringHashes tracking - xcode: set basename/group for addToPbxBuildFileSection helpers - tests for brace scanner strings and UISceneStoryboardFile removal Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com> * fix: address cubic follow-up on PR #115 review threads - Reorder SPM update: generate Package.swift before optional plugin patching - Ship typescript runtime dep for TS7 config strip-only fallback - CAPSceneDelegateProxy: find bridge in nested view-controller hierarchies - Changelog: dedupe ios 8.3.1, normalize cli plus block formatting Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com> * fix(cli): only catch Capacitor version lookup in SPM plugin patching Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com> --------- Co-authored-by: Github Workflow (on behalf of markemer) <users.noreply.github.com> Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> Co-authored-by: Alex J. <alexandre.jacinto@outsystems.com> Co-authored-by: Robin Genz <mail@robingenz.dev> Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: Minh Vu <vuhoangminh97@gmail.com> Co-authored-by: Pedro Bilro <pedro.gustavo.bilro@outsystems.com> Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> Co-authored-by: Conor Brady <con.brad@gmail.com> Co-authored-by: Omri Willheim <48905545+omriwil@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Manik Tyagi <tyagimanik77@gmail.com> Co-authored-by: Eric Horodyski <horodyski@ionic.io> Co-authored-by: Capacitor+ Bot <bot@capgo.app>
) * Release 8.3.2 * fix(cli): copy plugin files in CocoaPods projects (ionic-team#8467) * Release 8.3.3 * chore(cli): update telemetry endpoint (ionic-team#8464) * Release 8.3.4 * chore: format java code (ionic-team#8475) * chore: format java code (ionic-team#8477) * feat: add method getDouble to plugin config (ionic-team#7638) Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> * fix(SystemBars): make `safe-area-inset-x` available on API <= 34 (ionic-team#8424) * feat(cli): add experimental packageOptions (ionic-team#8471) * feat(cli): capture ios_package_manager in telemetry (ionic-team#8482) * fix(cli): revert live reload config on failure (ionic-team#8485) * chore: fix typo in declarations.ts (ionic-team#8488) * fix(SystemBars): respect `insetsHandling` disable (ionic-team#8481) * fix(android): show only the requested system bar (ionic-team#8480) Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: Pedro Bilro <pedro.gustavo.bilro@outsystems.com> Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> * chore: Decrease timeout for CI jobs from 60 to 30 minutes (ionic-team#8476) Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> * Release 8.4.0 * fix(cli): patch Capacitor SPM dependency version in plugins (ionic-team#8492) Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> * fix(cli): make SPM dependency patch work on prereleases (ionic-team#8508) * Release 8.4.1 * chore: run `npm run fmt` to fix lint errors (ionic-team#8516) * fix(android): explicitly grant URI permissions for image capture intent (ionic-team#8526) * Release 8.4.2 * chore(android): fix lint issues (ionic-team#8542) * fix(cli): support TypeScript 7 when loading capacitor.config.ts (ionic-team#8534) * feat(ios): UIScene Support (ionic-team#8536) * feat(cli): add migrator functionality for adopting UIScene (ionic-team#8544) * Release 8.5.0 * fix(cli): use POSIX paths in CapApp-SPM Package.swift (ionic-team#8549) Co-authored-by: Cursor <cursoragent@cursor.com> * fix(core): prevent removeListener from removing wrong listener (ionic-team#8271) Co-authored-by: Eric Horodyski <horodyski@ionic.io> * fix(sync): restore plus fork identity and upstream merge fixes Upstream-preferred conflict resolution incorrectly reverted @capacitor-plus package names, fork-specific UIScene migration logic, and several bug fixes. Restore plus-side resolutions while keeping upstream 8.5.0 sync content. - Restore @capacitor-plus/* package names at 8.5.1 - Fix duplicate requireTS, scene observers, and SPM update guard - Restore Swift-aware brace matching, xcode target membership, and scene proxy - Restore SystemBars safe-area calc, live-reload manifest cleanup, and tests - Revert CI job timeouts to 10 minutes per AGENTS.md policy Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com> * fix(android,cli): restore BoundedInputStream and plist test expectation Upstream sync dropped the BoundedInputStream inner class while keeping its usage in range handling. Restore the class from plus. Align migrate-uiscene-plist test with programmatic SceneDelegate migration (no UISceneStoryboardFile in generated manifest). Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com> * chore: trigger automated PR re-review after review fixes Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com> * fix(android): persist image capture picker state across recreation Restore static pending file-chooser fields in showImageCapturePicker so handlePendingFileChooserResult can deliver results after configuration changes, matching video capture and file picker behavior. Co-authored-by: Martin DONADIEU <martindonadieu@gmail.com> --------- Co-authored-by: Github Workflow (on behalf of markemer) <users.noreply.github.com> Co-authored-by: jcesarmobile <jcesarmobile@gmail.com> Co-authored-by: Alex J. <alexandre.jacinto@outsystems.com> Co-authored-by: Robin Genz <mail@robingenz.dev> Co-authored-by: Joey Pender <joey.pender@outsystems.com> Co-authored-by: Minh Vu <vuhoangminh97@gmail.com> Co-authored-by: Pedro Bilro <pedro.gustavo.bilro@outsystems.com> Co-authored-by: Mark Anderson <mark.anderson@outsystems.com> Co-authored-by: Conor Brady <con.brad@gmail.com> Co-authored-by: Omri Willheim <48905545+omriwil@users.noreply.github.com> Co-authored-by: Cursor <cursoragent@cursor.com> Co-authored-by: Manik Tyagi <tyagimanik77@gmail.com> Co-authored-by: Eric Horodyski <horodyski@ionic.io> Co-authored-by: Capacitor+ Bot <bot@capgo.app>






Description
This PR makes the custom injected
safe-area-inset-xCSS variables available for Android devices on API <= 34, to make dealing with UI safe area logic more consistent across Android versions.Change Type
Rationale / Problems Fixed
fixes: #8394
Tests or Reproductions
Screenshots / Media
Platforms Affected
Notes / Comments